package com.atguigu.lease.model.base;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.util.Date;

/**
 * @author LOGIN
 * @title BaseEntity
 * @create 2025/6/20 21:01
 * @description
 */
@Data
public class BaseEntity {
    @TableId(type = IdType.AUTO)
    private Long id;
    //只有自动更新时 才自动填充
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;
    // fill = FieldFill.INSERT_UPDATE，更新和新增时触发填充
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @TableField(value = "is_deleted")
    @TableLogic //表示当前属性为逻辑删除字段
    @JsonIgnore //表示jsckson 将对象转为json字符串时，忽略此属性
    private Boolean deleted=false;
}
